<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/15
 * Time: 11:33
 */

$a = 3;
$b = 1;
$c = $a ^ $b;

echo sprintf('%032b<br>',$a);
echo sprintf('%032b<br>',$b);
echo sprintf('%032b<br>',$c);;
echo sprintf('%032b<br>',~$c);;

$d = 10;
echo sprintf('%032b<br>',$d);;
echo sprintf('%032b<br>',$d<<2);;
echo sprintf('%032b<br>',$d>>2);;